package com.example.mobile2021606185zhn0512;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import android.os.Bundle;
import android.widget.TextView;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends AppCompatActivity {

    private TextView tvMainTitle;
    private RecyclerView adapt;
    private List<Mine> list = new ArrayList();
    private List<car> list01 = new ArrayList();
    private RecyclerView adapt01;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
        adapt.setLayoutManager(new LinearLayoutManager(MainActivity.this));
        adapt.setAdapter(new MineAdapt(list));
        list.add(new Mine(R.drawable.touxiang_2, "用户名：user1", "姓名：张小飞", "性别：男", "手机：123456789", "地址：佛山市高明区福湾镇学府路8号"));
        adapt01.setLayoutManager(new LinearLayoutManager(MainActivity.this));
        adapt01.setAdapter(new CarAdapt(list01));
        list01.add(new car(R.drawable.tesila,"粤E123456","ETC余额：2000"));
        list01.add(new car(R.drawable.richan,"粤E456789","ETC余额：200"));
    }


    private void initView() {
        tvMainTitle = findViewById(R.id.tv_main_title);
        adapt = findViewById(R.id.adapt);
        adapt01 = (RecyclerView) findViewById(R.id.adapt01);
    }
}